import './App.css';
import Tree from './components/Tree'

let nodes = [{
  id: '1',
  text: 'value_1',
  children: [{
    id: '1-1',
    text: 'value_1-1',
    children: [{
      id: '1-1-1',
      text: 'value_1-1-1'
    }],
  }]
}, {
  id: '2',
  text: 'value_2',
  children: [{
    id: '2-1',
    text: 'value_2-1',
    children: [{
      id: '2-1-1',
      text: 'value_2-1-1'
    },{
      id: '2-1-2',
      text: 'value_2-1-2'
    }],
  }]
}, {
  id: '3',
  text: 'value_3'
}];

function handleSelect(node) {
  console.log(node);
}

function App() {
  return (
    <div className="App">
      <div style={{width: '300px', margin: '15vh auto', textAlign: 'left'}}>
        <Tree nodes={nodes} onSelect={handleSelect}></Tree>
      </div>
    </div>
  );
}

export default App;
